using System;
using System.Text;
using System.Web;
namespace tenpay
{
	public class PayResponseHandler : ResponseHandler
	{
		public PayResponseHandler(HttpContext httpContext) : base(httpContext)
		{
		}
		public override bool isTenpaySign()
		{
			string parameter = base.getParameter("cmdno");
			string parameter2 = base.getParameter("pay_result");
			string parameter3 = base.getParameter("date");
			string parameter4 = base.getParameter("transaction_id");
			string parameter5 = base.getParameter("sp_billno");
			string parameter6 = base.getParameter("total_fee");
			string parameter7 = base.getParameter("fee_type");
			string parameter8 = base.getParameter("attach");
			string text = base.getParameter("sign").ToUpper();
			string key = base.getKey();
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append("cmdno=" + parameter + "&");
			stringBuilder.Append("pay_result=" + parameter2 + "&");
			stringBuilder.Append("date=" + parameter3 + "&");
			stringBuilder.Append("transaction_id=" + parameter4 + "&");
			stringBuilder.Append("sp_billno=" + parameter5 + "&");
			stringBuilder.Append("total_fee=" + parameter6 + "&");
			stringBuilder.Append("fee_type=" + parameter7 + "&");
			stringBuilder.Append("attach=" + parameter8 + "&");
			stringBuilder.Append("key=" + key);
			string mD = MD5Util.GetMD5(stringBuilder.ToString(), this.getCharset());
			base.setDebugInfo(string.Concat(new string[]
			{
				stringBuilder.ToString(),
				" => sign:",
				mD,
				" tenpaySign:",
				text
			}));
			return mD.Equals(text);
		}
	}
}
